package com.yaxin.b_tree;

import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;

import sun.reflect.CallerSensitive;

public class AccessControllerX{

    @CallerSensitive
    public static native <T> T
        doPrivileged(PrivilegedExceptionAction<T> action,
                     AccessControlContext context)
        throws PrivilegedActionException;
    
    
    public static void main(String[] args) throws PrivilegedActionException{
    	String re = AccessController.doPrivileged(new PrivilegedExceptionAction<String>(){

			@Override
			public String run() throws Exception {
				System.out.println("xxx");
				return "ok";
			}
    		
    	}, AccessController.getContext());
    	
    	System.out.println(re);
    }
}
